from django import template

register = template.Library()

@register.filter(name = 'post_cutter')
def post_cutter(value):
    cut_pos = value.find("<!--more-->")
    if cut_pos > 0:
        return value[:cut_pos]
    else:
        return value